import axios from "axios";
import qs from'qs'

export async function require(trackingNum) {
  return axios.get('http://172.16.81.238/query/trace/' + trackingNum)
}

export async function postPackage(form) {
  return axios({
    method: 'post',
    url: 'http://172.16.81.238/submit/order',
    headers: {
      'Content-Type': 'application/x-www-form-urlencoded'
    },
    data: qs.stringify(form)
  });
}

export function login (form) {
  return axios({
    method: 'post',
    url: 'http://172.16.81.238/LoginSuccess',
    headers: {
      'Content-Type': 'application/x-www-form-urlencoded'
    },
    data: qs.stringify(form)
  })
}

export function register(form) {
  return axios({
    method: 'post',
    url: 'http://172.16.81.238/RegisterSuccess',
    headers: {
      'Content-Type': 'application/x-www-form-urlencoded'
    },
    data: qs.stringify(form)
  })
}
